package assets_withdraw

import (
	"context"

	"gitee.com/liuxuezhan/ar-platform/admin-api/internal/svc"
	"gitee.com/liuxuezhan/ar-platform/admin-api/internal/types"
	"gitee.com/liuxuezhan/ar-platform/rpc-client/assetsClient/rpc"
	"github.com/zeromicro/go-zero/core/logx"
)

type UserAuthDelLogic struct {
	logx.Logger
	ctx    context.Context
	svcCtx *svc.ServiceContext
}

// 会员管理--实名认证--删除
func NewUserAuthDelLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UserAuthDelLogic {
	return &UserAuthDelLogic{
		Logger: logx.WithContext(ctx),
		ctx:    ctx,
		svcCtx: svcCtx,
	}
}

func (l *UserAuthDelLogic) UserAuthDel(req *types.UserAuthDelReq) (resp *types.UserAuthDelRes, err error) {
	rpc_req := &rpc.UserAuthDelReq{
		ID: req.ID,
	}
	// 发送请求
	_, err = l.svcCtx.AssetsRpc.PayWithdraw.UserAuthDel(l.ctx, rpc_req)
	if err != nil {
		return nil, err
	}

	// 处理请求返回的结果
	// 解析、组合数据
	resp = &types.UserAuthDelRes{}
	return
}
